import requests
from lxml import etree


url = 'http://gongbao.court.gov.cn/ArticleList.html'
res = requests.post(url, data={
    'serial_no': 'al',
    'page': "1"
}, headers={
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36',
    'X-Requested-With': 'XMLHttpRequest'

})
tree = etree.HTML(res.text)
lis = tree.xpath('//div[@id="grid"]/ul/li')
for li in lis:
    url = f'http://gongbao.court.gov.cn{li.xpath(".//a/@href")[0]}'
    title = li.xpath(".//a/text()")[0]
    print(url,title)
    res = requests.get(url)
    print(res.text)
    break


